﻿using System;
using System.Runtime.Serialization;
using LiSA_Server.Base.AbstractContracts;
using LiSA_Server.Base.Factories;
using LiSA_Service.Users.Actioners;

namespace LiSA_Service.Users.Dto.Queries
{
    [DataContract]
    public class UsernameQuery : Query
    {
        [DataMember]
        public string UserName { get; set; }

        [DataMember]
        public Guid UserID { get; set; }

        public override QueryResult Execute()
        {

            return new UsernameQueryResult
            {
                DoesUserExist = ActionerFactory.Instance.Get<UserActioner>().CheckUser(UserName, UserID)
            };
        }
    }
}